fix: makes skin tone picker more accessible #283
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #220
I still think this solution leaves a lot to be desired, but this is the best I could do for now while maintaining the existing design. I believe we should probably separate out the button that expands the menu and the buttons inside the menu, but this is a start.
<span>
s intorole="button"
. (It was too difficult to make them true<button>
s, but I would love a PR in the future to do that. ) 🙂 Because they aren't true buttons, we have to handletabindex
and keydown (enter/spacebar) ourselves.aria-haspopup
andaria-expanded
to indicate when the menu button is opened.<section>
witharia-label
set to thei18n.skintext
(default: 'Choose your default skin tone') so that it's easier to tell what this mass of<button>
s is there foraria-pressed
states for when the skintone is selected/unselected to show that it's a toggle buttonaria-label
andtitle
so that you can hover to see them. This necessitated some newi18n
defaults.This is definitely not where I would like it to be long-term, but at the very least you can now tab to the button, press spacebar/enter to expand, and then tab through the expanded buttons and press spacebar/enter to expand those.